package com.sinopec.ch34x.device.core.instruct

import com.sinopec.ch34x.device.core.init.ch34Driver

/**
 * lwj at 2023/5/18
 * 指令的类
 */
interface InstructAble {

    /**
     * lwj at 2023/5/18
     * 写数据
     */
    suspend fun write(instruct: Instruct): Boolean

    /**
     * lwj at 2023/5/18
     * 读数据
     */
    suspend fun read(): ByteArray

}


/**
 * lwj at 2023/5/18
 * 灯的控制器
 */
val instruct: InstructAble?
    get() {
        return SimpleInstructAble {
            ch34Driver
        }
    }